home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
source
/
swaga-c
/
copymove.swg
/
0011_Move File #2.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-05-28
|
789b
|
40 lines
{
> How would I move a File from within my Program.
if the File is to moved from & to the same partition,
all you have to do is:
Assign(F,OldPath);
Rename(F,NewPath);
On the other hand, if the File is to be moved to a different
partition, you will have to copy / erase the File.
Example:
}
Program MoveFile;
Var
fin,fout : File;
p : Pointer;
w : Word;
begin
GetMem(p,64000);
Assign(fin,ParamStr(1)); { Assumes command line parameter. }
Assign(fout,ParamStr(2));
Reset(fin);
ReWrite(fout);
While not Eof(fin) do
begin
BlockRead(fin,p^,64000,w);
BlockWrite(fout,p^,w);
end;
Close(fin);
Close(fout);
Erase(fin);
FreeMem(p,64000);
end.
{
This Program has NO error control.
}